
#ifndef _MEMBER_BMenuBar_H_
#define _MEMBER_BMenuBar_H_

#include <BRect>
#include <BStyle>
#include <BMenuBar>
#include "IAlignItem.h"

namespace BWE
{
	class MenuBarItem : public IAlignItem
	{
	public:
		MenuBarItem() : IAlignItem(0)
		{
			menu = 0;
			dirty = false;
		}
		MenuBarItem(BMenu* menu) : IAlignItem(menu)
		{
			this->menu = menu;
			dirty = true;
		}

		virtual void dispenseStyles(const BStyle* style);
		virtual void translateText(const BStyle* style);

		bool operator == (const BMenu* menu)
		{
			return this->menu == menu;
		}

		BMenu*		menu;
	};

	class member_BMenuBar : public BObject
	{
		friend class BMenuBar;
	public:
		member_BMenuBar(BMenuBar* menuBar);
		~member_BMenuBar();

		void freshRects();

		void slotMenuEnabled(BObject* object, const BValue& value);
		void slotMenuRenamed(BObject* object, const BValue& value);
		void slotMenuStyled(BObject* object, const BValue& value);
		void slotMenuIconChanged(BObject* object, const BValue& value);
		void slotMenuTitleChanged(BObject* object, const BValue& value);

		BMenuBar*			boss;
		Align				align;
		Form				form;
		int					spacing;
		Orientation			orientation;
		BSize				separatorSize;
		BImageHolder		separatorImage;
		const BStyle*		separatorStyle;

		bool				dirty;
		BSize				contentSize;
		int					hoverIndex;
		bool				pressed;
		BArray<MenuBarItem>	items;
	};
}

#endif